package com.yodawnla.easyPuyo.item;

import com.yodawnla.easyPuyo.HUD.GaChaResulHud;
import com.yodawnla.easyPuyo.character.Player;
import com.yodawnla.easyPuyo.stage.StageMgr;
import com.yodawnla.easyPuyo.system.Tex;

public class GaCha extends Item
{
	public GaCha(int price)
	{
		super(Tex.GaChaItemIcon);

		super.setPrice(price);
		
		mType = Type.GaCha;
	}

	@Override
	public void use()
	{
		Player player = Player.getInstance();
		int minValue = player.getLevel();
		int maxValue = player.getLevel() + StageMgr.getInstance().getTotalProgress() * 3;
		
		Equipment equipment = ItemMgr.getInstance().createRandomEquipment(minValue, maxValue, true, 0, 170, 110, 20);
		player.addItem(equipment);
		
		GaChaResulHud.getInstance().show(equipment);
	}
}